import http from "@/utils/request/httpRequest.ts";
import type { SettingType, sysColorType } from "@/types/SettingType.ts";
import outHttp from "@/utils/request/httpOutRequest.ts";

// 获取系统主题
export const getSystemTheme = () => http.get<sysColorType[]>("sys/dict/getDictItemList/sys_color")

// 顶部主题颜色
export const getTopColor = () => http.get<sysColorType[]>("sys/dict/getDictItemList/top_color")

// 菜单主题
export const getMenuColor = () => http.get<sysColorType[]>("sys/dict/getDictItemList/menu_color")

// 回显
export const getShow = (userId: number | string) => http.get<SettingType>(`sys/site/getByUid/${userId}`)
// export const getShowOut = (userId: number | string) => outHttp.get<SettingType>(`sys/site/getByUid/${userId}`)
export const getShowOut = (userId: number | string) => http.get<SettingType>(`sys/site/getByUid/${userId}`)
// 修改
export const editSetting = (data: object) => http.post("sys/site/update", data)

// 修改密码
export const EditPassword = (data: object) => http.post("sys/user/updatePassword", data)

// 查询所有角色
export const roleList = () => http.get("sys/user/getUserRoleList")
export const roleListOut = () => outHttp.get("sys/user/getUserRoleList")
// export const roleListOut = () => http.get("sys/user/getUserRoleList")

// 用户切换角色
export const changeRole = (roleId: number) => http.get(`sys/user/switchRole?roleId=${roleId}`)

// 动态化系统名称
export const getSystemName = () => http.get("sysParam/getByParamKey/system_name")

export const getSystemNameOut = () => outHttp.get("sysParam/getByParamKey/system_name")
// export const getSystemNameOut = () => http.get("sysParam/getByParamKey/system_name")

// 动态化页脚
export const getFooter = () => http.get("sysParam/getByParamKey/foot_text")
export const getFooterOut = () => outHttp.get("sysParam/getByParamKey/foot_text")
// export const getFooterOut = () => http.get("sysParam/getByParamKey/foot_text")
// 是否允许手机号登录
export const getPhoneLogin = () => http.get("sysParam/getByParamKey/enable_phone_login")


// 专家修改密码
export const TeacherEditPassword = (data: object) => outHttp.post("teacher/changePwd", data)
// export const TeacherEditPassword = (data: object) => http.post("teacher/changePwd", data)